package org.yn.auth.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.yn.auth.service.IPermissionScanService;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

//ServletContextListener上下文监听器，可以监听程序是否启动
@WebListener
public class PermissionListener implements ServletContextListener {
    @Autowired
    IPermissionScanService permissionScanService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("监听到程序启动");
        System.out.println("+++++++++++开启扫描++++++++++++++++++++");
        permissionScanService.scan();

        System.out.println("+++++++++++开启结束++++++++++++++++++++");







    }
    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
